package com.yellow.dispatchservice.listener;

import org.springframework.amqp.core.ExchangeTypes;
import org.springframework.amqp.rabbit.annotation.Exchange;
import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.QueueBinding;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @author: hy
 * @create: 2024-03-13
 */
@Component
public class orderListener {

    @RabbitListener(bindings = @QueueBinding(
            value=@Queue(name = "mark.order.pay.queue",durable = "true"),
            exchange = @Exchange(name = "pay.topic",type = ExchangeTypes.TOPIC),
            key ={"pay.success"}
    ))
    public void listenOrder(Long orderId){
        //标记订单状态为已支付
        System.out.print("orderId "+orderId+" 订单已支付，请立刻分发订单");
    }
}
